package com.ijuit.web.user;

import com.ijuit.business.interfaces.user.UserService;
import com.ijuit.model.user.User;
import com.jfinal.aop.Before;
import com.jfinal.core.Controller;
import com.jfinal.plugin.spring.Inject;
import com.jfinal.plugin.spring.IocInterceptor;

/**
 * 用户信息
 * 
 * @author 罗龙
 *
 */
@Before(IocInterceptor.class)
public class UserAction extends Controller{
	@Inject.BY_NAME
    private UserService userService;
	
	/**
	 * 主页面
	 */
	public void index() {
		setAttr("userPage", User.me.paginate(getParaToInt(0, 1), 10));
		render("user.html");
	}
	/**
	 * 注册
	 */
	public void register(){
		
	}
	public void edit(){
		try {
			userService.edit(getModel(User.class));
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
